local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script,script.Parent.base,script.Parent.Name);

local ColliderManager = CommonOHOH.load.ColliderManager();
local ColliderGroup = CommonOHOH.load.ColliderGroup();




function M.new(...)
	return M(...);
end;

function M.ctor(self,trianId,obj,player,trainCtrl)

   M.super.ctor(self,trianId,obj,player,player:GetComponent(_G.ClientOHOH.load.Client_PlayerDataComponent()),trainCtrl);

   ColliderManager:SetAllGroup(self.main_inst, ColliderGroup.monster);
   self:AddPrivateComponentByFolder(script.Parent.cli)

   self.Syn=self.player:GetComponent(_G.CommonOHOH.load.Common_ActionSynchronize());

   self.HurtEvent:Connect(function()
        self:PushData2Server()
   end)
   
   self.DieEvent:Connect(function()
    self:PushData2Server()
end)

end;


function M.PushData2Server(self)
    self.Syn:Push({
		actionId= "DataFromClient",
        class="Common_TrainCtrl",
		arg={
			guid=self:GetGuid(),
		}
	})
end



function M.dtor(self)
	M.super.dtor(self);
end;


function M.GetAutoTrinAtt(self)
    return  self.main_inst.Touch.player
 end


return M
